doctype html
html(lang='en')
  head
    include ../meta
    title outline.js - 自动生成文章导读（Table of Contents）导航的 JavaScript 工具
    link(href="../css/example.min.css" rel="stylesheet")
  body
    .paper
      header#header.header
        h1.title Outline.js
      article#article.article
        aside#aside.article__aside.ltr
        main#main.article__main
          include ./article
          include ../options/section
          include ../properties/section
          include ../methods/section
          include ../events/section
          h2 License
          p JavaScript Code Licensed under MIT License.
          p API Documentation Licensed under CC BY 3.0
      footer.footer
        include ../footer
    script(src="../js/outline.min.js")
    script.
      const $header = document.querySelector('#header')
        const HEADER_STICKY = 'header_sticky'
        const defaults = Outline.DEFAULTS
        let outline

        defaults.position = 'fixed'
        defaults.parentElement = '#aside'
        defaults.stickyHeight = 86
        defaults.homepage = '../index.html'
        defaults.hasToolbar = false
        defaults.afterSticky = function(closed, isStickying) {
          const $nav = this.$el
          const BORDER_RIGHT = 'utils-border-right'

          if (closed) {
            return false
          }

          if (isStickying) {
            $nav.classList.add(BORDER_RIGHT)
            $header.classList.add(HEADER_STICKY)
          } else {
            $nav.classList.remove(BORDER_RIGHT)
            $header.classList.remove(HEADER_STICKY)
          }
        }
        defaults.afterToggle = function(closed, isStickying) {
          if (!isStickying) {
            return false
          }

          if (closed) {
            $header.classList.remove(HEADER_STICKY)
          } else {
            $header.classList.add(HEADER_STICKY)
          }
        }
        defaults.afterScroll = function(top) {
          console.log('top', top)
        }
        outline = new Outline(defaults)

        // outline.reload({
        //   position: 'relative',
        //   hasToolbar: true
        // })
